<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件</title>
</head>
<body>
    <button onclick="click_on()">das</button>
    <input type="text" onfocus="focus_on()" onblur="lost_focus()">
    <script>
        // 点击事件
        function click_on () {
            alert("点击一次");
        }

        // 聚焦事件
        function focus_on() {
            console.log("获得焦点");
        }

        // 失去焦点
        function lost_focus() {
            console.log("失去焦点");
        }
    </script>
</body>
</html>